export namespace N_TaskStatistics {
  export type QueryType =
    | 'daily'
    | 'process_daily'
    | 'history'
    | 'process_history';
  export type PeriodType = 'day' | 'week' | 'month' | 'quarter' | 'year';
  export type CategoryType = 'hang_group' | 'work_order' | 'part';

  export interface StatusValues {
    pending: number;
    processing: number;
    completed: number;
  }

  export interface realTimeTotalData {
    hang_group: StatusValues;
    work_order: StatusValues;
    part: StatusValues;
  }

  export interface realTimeProcessData extends StatusValues {
    process: string;
  }

  export interface historyTotalData {
    date: string;
    hang_group: number;
    work_order: number;
    part: number;
  }

  export interface historyProcessData {
    date: string;
    process: string;
    num: number;
  }

  export interface TaskStatisticsRequest {
    funName: string;
    title: string;
    from: string;
    data: {
      query_type: QueryType;
      date: string | [string, string];
      status?: string[];
      category: CategoryType[];
      period?: PeriodType;
    };
  }

  export interface DailyStatisticsResponse {
    query_type: QueryType;
    data: realTimeTotalData;
  }

  export interface ProcessDailyStatisticsResponse {
    query_type: QueryType;
    data: realTimeProcessData[];
  }

  export interface HistoryStatisticsResponse {
    query_type: QueryType;
    data: historyTotalData[];
  }

  export interface ProcessHistoryStatisticsResponse {
    query_type: QueryType;
    data: historyProcessData[];
  }
}
